package com.example.controller;

import com.example.entity.LeaveRecords;
import com.example.service.LeaveRecordsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description
 * @Author 张甲升
 * @create 2021-11-09-14:33
 */
@RestController
@RequestMapping("/leaveRecords")
public class LeaveRecordsController {
    @Resource
    private LeaveRecordsService leaveRecordsService;

    @GetMapping("/query")
    public List<LeaveRecords> query(){
        List<LeaveRecords> list = leaveRecordsService.query();
        return list;
    }

    @PostMapping("/insert")
    public int insert(LeaveRecords leaveRecords){
        return leaveRecordsService.add(leaveRecords);
    }

    @DeleteMapping("/delete")
    public int delete(int id){
        return leaveRecordsService.del(id);
    }
}
